import { IRole } from '@interfaces/role.interface';

export type MenuType = {
  directory: any;
  menu: any;
  button: any;
  api: any;
};

export interface IMenu {
  id: number;
  name: string;
  type: keyof MenuType;
  parentId: number | null;
  permCode: string | null;
  title: string;
  component: string;
  path: string | null;
  icon: string | null;
  activeMenu: string | null;
  status: boolean;
  hidden: boolean;
  alwaysShow: boolean;
  noCache: boolean;
  breadcrumb: boolean;
  affix: boolean;
  noTagsView: boolean;
  canTo: boolean;
  sort: number;
  createdAt: Date;
  updatedAt: Date;

  // 可选的关联字段
  parentMenu?: IMenu | null;
  children?: IMenu[];
  roles?: IRole[];
}

export interface IMenuPageResult {
  total: number;
  list: IMenu[];
}
